home *** CD-ROM | disk | FTP | other *** search
/ FM Towns: Free Software Collection 9 / FM Towns Free Software Collection 9.iso / t_os / data / fapx / fapxlmes.plp < prev    next >
Text File  |  1994-11-16  |  9KB  |  389 lines

  1. /*    指定された会議室の未読を全部読む    */
  2. %MESREAD{
  3.     [boadlist]
  4.     case    (boadlist<>{},
  5.         {Yes},
  6.         {
  7.         display(fname|{の未読を読みます\n});
  8.         type({MES\n});
  9.         Where:={forum/}|@nth(Where,2,{/})|{/mes};
  10.         loop    (
  11.         {
  12.         wait    (Wtime2,{AbortOff({ホストの反応が鈍いよぉ~\n})},
  13.             {-現在会議室には登録されていません-},
  14.             {
  15.             WAITABORT(Wtime2);
  16.             SNDMSG({okasi_f.snd});
  17.             display({会議室登録を確認してください\n});
  18.             },
  19.             {現在、サービスは大変混雑しています。},
  20.             {
  21.             WAITABORT(Wtime2);
  22.             SNDMSG({okasi_f.snd});
  23.             display({混雑のため次の処理に移ります\n});
  24.             },
  25.             {\n>},
  26.             {case    (boadlist={MES}||boadlist={mes},{Yes},{},{No},
  27.             {
  28.             %limit    @case(LIMIT,{},{im({})},,{im({ LIMIT:}|LIMIT)});
  29.             type({MREAD}|limit|{ ROOM:}|boadlist);type({\n});
  30.             loop    ({
  31.                 wait    (,,
  32.                     { }|@xc({08})|CRLF|{>},
  33.                     {flag0:={No};im({No})},
  34.                     { }|@xc({08})|CRLF|
  35.                     {電子会議 (1:発言 改行のみ: 読む)}|
  36.                     { 通常モード}|CRLF|{>},
  37.                     {flag0:={No};im({No})},
  38.                     {◆現在未読の発言はありません◆\n>},
  39.                     {
  40.                     %a    @laststr(128);
  41.                     wait(1);
  42.                     %b    @laststr(128);
  43.                     case    (a=b,
  44.                         {Yes},{flag0:={Yes};im({No})},
  45.                         {No},{im({Yes})}
  46.                         );
  47.                     },
  48.                     {◆該当する会議室がありません◆\n>},
  49.                     {
  50.                     %a    @laststr(128);
  51.                     wait(1);
  52.                     %b    @laststr(128);
  53.                     case    (a=b,
  54.                         {Yes},{flag0:={Yes};im({No})},
  55.                         {No},{im({Yes})}
  56.                         );
  57.                     },
  58.                     {◆あと 2分間入力がないと回線が切断}|
  59.                         {されます◆\n}|BELL|{\n},
  60.                     {
  61.                     flag0:={No};
  62.                     %a    @laststr(128);
  63.                     wait(1);
  64.                     %b    @laststr(128);
  65.                     im(a<>b)
  66.                     },
  67.                     { -\n>},
  68.                     {
  69.                     flag0:={No};
  70.                     %a    @laststr(128);
  71.                     wait(1);
  72.                     %b    @laststr(128);
  73.                     im(a<>b)
  74.                     });
  75.                 });
  76.             }    )
  77.             },
  78.             {\n},
  79.             {
  80.             write    (TEMP2|{mesl.tmp},/* 会議室名一覧出力    */
  81.                 @tail(@body(@laststr(90),,{\n}),{\n})|CRLF);
  82.             im({Yes})
  83.             })
  84.         }    )
  85.         });
  86.     };
  87.  
  88. /*    未読タイトル一覧表を表示 RTN(FORUM)    */
  89. %RTNFRM    {
  90.     [boadlist]
  91.     var    rtnboad [55];
  92.     %readRTN{
  93.         var    RTNDIR [64];
  94.         var    NewMes [1];
  95.         NewMes:=0;
  96.         dispoff(!DEBUG);
  97.         display({\nFORUM:}|fname|{ MES:}|rtnno|{\n}|
  98.             {\nmltitle=『}|mltitle|{』\n}|
  99.             {会議室名:}|MesTitle|{\n}|
  100.             {発言数=}|ut|{個\n}|
  101.             {未読数=}|rc|{個\n});
  102.         dispoff({No});
  103.         case    (ut - rc = 0,
  104.             {Yes},
  105.             {display({\n新規会議室として処理します。m(_ _)m\n});
  106.              NewMes:=1});
  107.         case    (rc>0,
  108.             {Yes},
  109.             {
  110.             case(skim={},{No},{PAUSE(fname)});
  111.             footnote(fname|{の未読タイトルリストを}|
  112.                 {ダウンロードしています});
  113.             display({\n}|fname|{の未読タイトルリストを}|
  114.                 {ダウンロードしています\n});
  115.             %errmsg    {
  116.                 SNDMSG({okasi_f.snd});
  117.                 display(rtnno|{番会議室は未読読み指定と重複}|
  118.                 {している可能性があります。\n});
  119.                 display({重複してない場合は、詳細をご報告}|
  120.                     {下さい。m(__)mペコリ\n});
  121.                 };
  122.             %endrtn    {
  123.                 wait(,,{改行のみ: 読む) 通常モード\n>},,
  124.                 {改行のみ: 読む) ペアレントモード\n>});
  125.                 type({RC MAX\n});
  126.                 write(RTNDIR|{\}|RTNFILE,
  127.                     { ***  作成 = }|@daylong|{  ***\n});
  128.                 };
  129.             %RTNFILE {MES}|@ZERO(rtnno,2)|{.RTN};
  130.             case    (@dir2(LOG)=@dir2(CATLOG)||
  131.                     (LOGmode={forum}&&COMPRESS={No}),
  132.                 {Yes},
  133.                 {RTNDIR:=LOG2|fname|{\RTN}},
  134.                 {No},
  135.                 {RTNDIR:=LOG2|{RTN\}|fname},
  136.                 );
  137.             case    (@filechk(RTNDIR|{\}|RTNFILE),
  138.                 {Yes},
  139.                 {
  140.                 type({RTN\n});
  141.                 wait(Wtime2,{AbortOff({ホストが重いよぉ~})},
  142.                     { 題名\n},
  143.                     {
  144.                     receive(RTNDIR|{\}|RTNFILE);
  145.                     wait(,,{\n>},{stoprec;type({\n})});
  146.                     endrtn;
  147.                     },
  148.                     {◆現在未読の発言はありません◆},
  149.                     {errmsg});
  150.                 },
  151.                 {No},
  152.                 {
  153.                 mkdir2(RTNDIR);
  154.                 %fhd {FORUM:}|fname;
  155.                 write(RTNDIR|{\}|RTNFILE,
  156.                     fhd|{ MES:}|rtnno|@hyp(fhd,rtnno)|
  157.                     {--------------------------------}|
  158.                     {---- List by FAPX\n}|FTITLE|
  159.                     { 会議室:}|MesTitle|CRLF);
  160.                 type({RTN\n});
  161.                 WAITCHAR(Wtime2,{RTN\n},
  162.                     {receive(RTNDIR|{\}|RTNFILE)});
  163.                 wait(,,{\n>},{stoprec;type({\n});endrtn},
  164.                     {◆現在未読の発言はありません◆},
  165.                     {stoprec;delfile(RTNDIR|{\}|RTNFILE);
  166.                     errmsg;
  167.                     });
  168.                 });
  169.             wait(,,{改行のみ: 読む) 通常モード\n>},,
  170.                 {改行のみ: 読む) ペアレントモード\n>});
  171.             case(skim={},{No},{RESUME(fname);skmsg});
  172.             });
  173.         };
  174.  
  175.     case    ( boadlist = {ALL} || boadlist = {all},
  176.         {Yes},
  177.         {
  178.         rtnboad:={};
  179.         type({MES\n});
  180.         Where:={forum/}|@nth(Where,2,{/})|{/mes};
  181.         loop    ({
  182.             wait    (Wtime2,{AbortOff(
  183.                     {\nホストの反応が鈍いよぉ~\n})},
  184.                 {\n>},{im({No})},
  185.                 {\n},
  186.                 {    /* 会議室名一覧出力    */
  187.                 %mli @tail(@body(@laststr(90),,{\n}),{\n});
  188.                 write(TEMP2|{mesl.tmp},mli|CRLF);
  189.                     /*    ALL用変数代入    */
  190.                 %mx @getchar(mli,1,2)+1-1;
  191.                 case(@getchar(mli,17,4),
  192.                     {)   },{rtnboad:=rtnboad|{,}|mx});
  193.                 im({Yes});
  194.                 });
  195.             });
  196.         rtnboad:=@getchar(rtnboad,2)
  197.         },
  198.         {No},{rtnboad:=boadlist}
  199.         );
  200.     case(DEBUG,{Yes},{display({\nrtnboad=}|rtnboad|{\n})});
  201.     var    pflag    [3];    /* SET PAUSE ON フラグ */
  202.     %mesp TEMP2|{mesl.tmp};
  203.     %rctl UP2|{fapxrtn.ctl};
  204.     var    MesTitle [50];
  205.     var    ut [5];
  206.     var    rc [4];
  207.     %skmsg    {
  208.         display({指定発言の自動ダウンロードを開始します\n});
  209.         footnote({指定発言の自動ダウンロードをしています});
  210.         };
  211.     %deftit    {    /*変数定義*/
  212.         case    (@filechk(mesp),
  213.             {Yes},
  214.             {
  215.             %md @head(@body(@read(mesp),{\n}|
  216.                 @SPP(rtnno,2,)|{   }),{\n});
  217.             MesTitle:=@getchar(md,24);
  218.             ut:=@getchar(md,1,5)+1-1;
  219.             rc:=@getchar(md,8,4)+1-1;
  220.             },
  221.             {No},
  222.             {MesTitle:=@body(mltitle,{議室}|@SPP(rtnno,2,)|
  223.                 {  },{  発言数 :});
  224.             ut:=@head(@body(mltitle,{発言数 :}),{ 未読 });
  225.             rc:=@head(@body(mltitle,{未読 :}),{-\n});
  226.             });
  227.         case(@exist({,}|mes|{,},{,}|rtnno|{,}),{Yes},
  228.             {rc:=0;
  229.             SNDMSG({okasi_f.snd});
  230.             display(rtnno|{番会議室は未読読み指定と重複}|
  231.             {していますので、RTN取得指定から除外します。\n});
  232.             });
  233.         };
  234.     loop    ({/*    RTN及び指定発言のダウンロード    */
  235.         %rtnno    @head(rtnboad,{,});
  236.         case    (rtnno,
  237.             {},{im({No})},
  238.             ,
  239.             {
  240.             deftit;
  241.             %rtk {forum=}|fname|{;mes=}|rtnno|{;rtn=};
  242.             %skim    @case    (@filechk(rctl),
  243.                     {Yes},
  244.                     {
  245.                     %rs @head(@body(@read(rctl),rtk),{\n});
  246.                     case    ((rs<>{}&& DNT<>{No}&&
  247.                         ((@filechk(mesp)={Yes}&&rc>0)||
  248.                         @filechk(mesp)={No})),
  249.                         {Yes},
  250.                         {rewrite;im(rs)},
  251.                         {No},{im({})}
  252.                         );
  253.                     },
  254.                     {No},{im({})}
  255.                     );
  256.             dispoff(!DEBUG);
  257.             display({指定された発言番号:#}|skim|{x\n});
  258.             dispoff({No});
  259.             case    ((@filechk(mesp)={Yes}&&rc>0)||
  260.                 @filechk(mesp)={No},
  261.                 {Yes},
  262.                 {
  263.                 case    (skim,{},{PAUSE(fname)},
  264.                     ,
  265.                     {
  266.                     case    (pflag={Yes},
  267.                         {No},
  268.                         {
  269.                         type({SET PAUSE OFF\n});
  270.                         WAITABORT(Wtime2);
  271.                         pflag:={Yes};
  272.                         });
  273.                     });
  274.                 case(@GO({forum/}|fname|{/mes/}|rtnno)<>{No},
  275.                     {Yes},
  276.                     {
  277.                     deftit;readRTN;
  278.                     case(skim<>{},{Yes},
  279.                         {FDwn1;
  280.                         loop    ({
  281.                             %rs @head(@body(@read
  282.                             (rctl),rtk),{\n});
  283.                             case(rs,{},{im({No})},,
  284.                             {rewrite;%skim rs;
  285.                             case(DEBUG,{Yes},
  286.                             {display({指定された}|
  287.                             {発言番号:#}|
  288.                             skim|{y\n})});
  289.                             FDwn1;im({Yes})});
  290.                             });
  291.                         })
  292.                     });
  293.                 case(skim,{},{RESUME(fname)})
  294.                 });
  295.             rtnboad:=@body(rtnboad,{,});
  296.             im({Yes});
  297.             });
  298.         });
  299.     case    (@filechk(rctl),
  300.         {Yes},
  301.         {
  302.         %rtk {forum=}|fname|{;mes=};
  303.         loop    ({/*    指定発言のダウンロード    */
  304.             %rs @head(@body(@read(rctl),rtk),{\n});
  305.             case    (rs<>{}&&DNT<>{No},
  306.                 {No},{im({No})},
  307.                 {Yes},
  308.                 {
  309.                 rewrite;
  310.                 %rtnno @head(rs,{;});
  311.                 %skim  @tail(rs,{;rtn=});
  312.                 case    (pflag={Yes},
  313.                     {No},
  314.                     {
  315.                     skmsg;
  316.                     type({SET PAUSE OFF\n});
  317.                     WAITABORT(Wtime2);
  318.                     pflag:={Yes};
  319.                     });
  320.                 case(@GO({forum/}|fname|{/mes/}|rtnno)<>{No},
  321.                     {Yes},{deftit;FDwn1});
  322.                 im({Yes})
  323.                 });
  324.             });
  325.         });
  326.     case    (@fileleng(rctl),{0},
  327.         {
  328.         delfile(rctl);
  329.         copyfile(UP2|{fapxrtn.rsv},UP2|{fapxrtn.bak});
  330.         delfile(UP2|{fapxrtn.rsv});
  331.         });
  332.     };
  333.  
  334. %FDwn1    {
  335.     %PrmptChk{
  336.         wait    (,,
  337.             {入力して下さい◆\n}|
  338.             {電子会議 (1:発言 改行のみ: 読む) 通常モード\n>},
  339.             {im({Error})},
  340.             {入力して下さい◆\n電子会議 }|
  341.             {(1:発言  改行のみ: 読む) ペアレントモード\n>},
  342.             {im({Error})},
  343.             {入力して下さい◆\n}|
  344.             {電子会議 (改行のみ: 読む) 通常モード\n>},
  345.             {im({Error})},
  346.             {入力して下さい◆\n}|
  347.             {電子会議 (改行のみ: 読む) ペアレントモード\n>},
  348.             {im({Error})},
  349.             {\n電子会議 (1:発言 改行のみ: 読む) 通常モード\n>},
  350.             {im({Ok})},
  351.             {\n電子会議 (1:発言  改行のみ: 読む)}|
  352.             { ペアレントモード\n>},
  353.             {im({Ok})},
  354.             {\n電子会議 (1:発言 2:コメントを読む }|
  355.             {改行のみ: 読む) 通常モード\n>},
  356.             {im({Ok})},
  357.             {\n電子会議 (改行のみ: 読む) 通常モード\n>},
  358.             {im({Ok})},
  359.             {\n電子会議 (改行のみ: 読む) ペアレントモード\n>},
  360.             {im({Ok})},
  361.             {\n電子会議 (1:コメントを読む 改行のみ: 読む)}|
  362.             { 通常モード\n>},
  363.             {im({Ok})}
  364.             );
  365.         };
  366.     case    (@TypeNum(ut,{999}),
  367.         {OK},
  368.         {
  369.         case    (@PrmptChk,
  370.             {Error},
  371.             {
  372.             case    (@TypeNum(ut,{512}),
  373.                 {OK},
  374.                 {
  375.                 case    (@PrmptChk,
  376.                     {Error},
  377.                     {display(
  378.                         {\n作動が一寸おかしいです。\n})},
  379.                     {Ok},{flag0:={No};/*正常作動*/}
  380.                     );
  381.                 });
  382.             },
  383.             {Ok},{flag0:={No};/*正常作動*/});
  384.         });
  385.     };
  386.  
  387. MESREAD(mes);
  388. RTNFRM(rtn);
  389.